﻿using MaxLeaf.Platform.BLLProxy;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using MaxLeaf.Platform.DataContract;
using System.Collections.Generic;

namespace BLLUnitTest
{
    
    
    /// <summary>
    ///这是 MtnBLLProxyTest 的测试类，旨在
    ///包含所有 MtnBLLProxyTest 单元测试
    ///</summary>
    [TestClass()]
    public class MtnBLLProxyTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///获取或设置测试上下文，上下文提供
        ///有关当前测试运行及其功能的信息。
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region 附加测试特性
        // 
        //编写测试时，还可使用以下特性:
        //
        //使用 ClassInitialize 在运行类中的第一个测试前先运行代码
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //使用 ClassCleanup 在运行完类中的所有测试后再运行代码
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //使用 TestInitialize 在运行每个测试前先运行代码
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //使用 TestCleanup 在运行完每个测试后运行代码
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///Add 的测试
        ///</summary>
        [TestMethod()]
        public void AddTest()
        {
            
            MtnBLLProxy target = new MtnBLLProxy(); // TODO: 初始化为适当的值
            object model = new SCPCategoryDataModel {  CompanyID=1,info="aaa", Key=11, Name="bbb", num=444, sys =true, Void=false  };
            object expected = target.Add(model);
            object actual = target.Add(model);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///Delete 的测试
        ///</summary>
        [TestMethod()]
        public void DeleteTest()
        {
            MtnBLLProxy target = new MtnBLLProxy(); // TODO: 初始化为适当的值
            object model = new MtnBLLProxy().Select(new SCPCategoryApproUserDataModel(),82); // TODO: 初始化为适当的值
            bool expected = false; // TODO: 初始化为适当的值
            bool actual;
            actual = target.Delete(model);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SelectByCond 的测试
        ///</summary>
        [TestMethod()]
        public void SelectByCondTest()
        {
            object model1 = new MtnBLLProxy().SelectByCond(new ImInvMasterQryNoInvDataModel { UI_CompanyID = 3 }, new List<AddInfo> {
                new AddInfo{ Name = AddInfoType.PageInfo , Value =new PageInfo{ PageIndex =2, PageSize=2}}
            }).Data;
           
            //MtnBLLProxy target = new MtnBLLProxy(); // TODO: 初始化为适当的值
            //object model = null; // TODO: 初始化为适当的值
            //List<AddInfo> lstAddInfo = null; // TODO: 初始化为适当的值
            //SelectResult expected = null; // TODO: 初始化为适当的值
            //SelectResult actual;
            //actual = target.SelectByCond(model, lstAddInfo);
            //Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///Sum 的测试
        ///</summary>
        [TestMethod()]
        public void SumTest()
        {
            MtnBLLProxy target = new MtnBLLProxy(); // TODO: 初始化为适当的值
            object model = null; // TODO: 初始化为适当的值
            List<AddInfo> lstAddInfo = null; // TODO: 初始化为适当的值
            SumResult expected = null; // TODO: 初始化为适当的值
            SumResult actual;
            actual = target.Sum(model, lstAddInfo);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///Update 的测试
        ///</summary>
        [TestMethod()]
        public void UpdateTest()
        {
            MtnBLLProxy target = new MtnBLLProxy(); // TODO: 初始化为适当的值
            object model = target.Select(new goods_SCPCategoryDataModel(),93); // TODO: 初始化为适当的值
            object expected = null; // TODO: 初始化为适当的值
            object actual;
            
            actual = target.Update(model);
            //Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("验证此测试方法的正确性。");
        }


        /// <summary>
        ///Update 的测试
        ///</summary>
        [TestMethod()]
        public void UpdateTest1()
        {
            CategroyApproBLLProxy target = new CategroyApproBLLProxy(); // TODO: 初始化为适当的值
            CategroyApproDataModel model = new CategroyApproDataModel(); // TODO: 初始化为适当的值
            model.BillFinterID = "10";
            model.CompanyID = "2";
            model.FinterIDType = 6;
            model.SCPCategorySeqNo = "1";
            model.UserID = "6";

            CategroyApproDataModel expected = model; // TODO: 初始化为适当的值
            CategroyApproDataModel actual;
            actual = target.DepartApproval(model);
            Assert.AreEqual(expected, actual);
        }
    }
}
